{% extends 'PrincipalBundle:Default:base.html.twig' %}
{% block title %}Alta de Usuario{% endblock %}
{% block contenido %}

<h1>Nuevo Usuario</h1>

<form id="form-new" action="{{ path('usuarios_create') }}" method="post" {{ form_enctype(form) }}>
    {{ form_errors(form) }}
    {{ form_row(form.usuario) }}
    {{ form_row(form.password) }}
    {{ form_row(form.nombre) }}
    {{ form_row(form.apellido) }}

    {{ form_rest(form) }}
</form>
<ul class="record_actions" style="margin-left: 40px;">
    <li>
        <a id="guardar" class="button_ok">
            <span>Guardar</span>
        </a>
        <a href="{{ path('usuarios') }}" class="button_grey">
            <span>Cancelar</span>
        </a>
    </li>
</ul>
{% endblock %}

{% block javascripts %}
<script type="text/javascript">
    $(document).ready(function(){
        $('#guardar').click(function(){
            $('#form-new').submit();
        });
    });
</script>
{% endblock %}